package cn.south.campus.admin.campus.model.vo;

import cn.south.campus.admin.campus.model.entity.WithdrawalAudit;
import cn.south.campus.common.model.vo.BaseVO;
import cn.south.campus.common.utils.DateUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 *
 * </p>
 *
 * @author chow
 * @since 2024/11/14 14:50
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class WithdrawalAuditVo extends BaseVO {
    /**
     * 用户id
     */
    private Long userId;

    private String nickname;

    private String phone;

    /**
     * 提现金额
     */
    private String amount;

    /**
     * 状态：0-待审核，1-审核通过，2-审核不通过
     */
    private Integer status;

    public static WithdrawalAuditVo convert(WithdrawalAudit withdrawalAudit) {
        WithdrawalAuditVo withdrawalAuditVo = new WithdrawalAuditVo();
        withdrawalAuditVo.setUserId(withdrawalAudit.getUserId());
        withdrawalAuditVo.setAmount(withdrawalAudit.getAmount().toString());
        withdrawalAuditVo.setStatus(withdrawalAudit.getStatus());
        withdrawalAuditVo.setNickname(withdrawalAudit.getNickname());
        withdrawalAuditVo.setPhone(withdrawalAudit.getPhone());
        withdrawalAuditVo.setCreateTime(DateUtil.format(withdrawalAudit.getCreateTime()));
        withdrawalAuditVo.setUpdateTime(DateUtil.format(withdrawalAudit.getUpdateTime()));
        withdrawalAuditVo.setId(withdrawalAudit.getId());
        return withdrawalAuditVo;
    }
}
